
<div class="loading_bg" style="z-index: 999" ng-click="onClose()">
</div>
<div class="new_target_windows">
    <div class="ntw_content">
        <div class="title">
            <h1>
                培训任务</h1>
            <div class="close" ng-click="onClose()">
                <span>+</span></div>
            <div class="clear">
            </div>
        </div>
        <!-- 任务名称 -->
        <ul class="ulzu">
            <li><i class="iconfont">&#xe652;</i>任务名称：<input type="text" placeholder="培训计划名称(必填)"
                ng-model="taskObj.name" set-focus="" ng-style="taskNameStyle" ng-focus="taskNameFocusStyle()"
                ng-blur="taskNameBlurStyle()" class="xiaoge"></li>
            <li>
                <span><i class="iconfont">&#xe6e7;</i>报名参与：{{taskObj.isReviewed?'需报名审核通过后可学习':'无需审核直接学习'}}</span> 
                <span class="lirbtn" style="right: 240px;">
                    
                    <div class="toggle" style="float: right;margin-left: 10px;margin-top: 5px;">
                        <input class="notificationHandler check" ng-class="{checked:taskObj.isReviewed}" ng-click="taskObj.isReviewed=!taskObj.isReviewed"
                            data-type="newpost.email" type="button">
                        <div class="switch">
                        </div>
                        <div class="track">
                        </div>
                    </div>
                </span>
            </li>
            <li>
                <span><i class="iconfont">&#xe6e7;</i>任务类型：{{taskObj.isStudy?'必修':'选修'}}</span> 
                <span class="lirbtn" style="right: 240px;">
                    <div class="toggle" style="float: right;margin-left: 10px;margin-top: 5px;">
                        <input class="notificationHandler check" ng-class="{checked:taskObj.isStudy}" ng-click="taskObj.isStudy=!taskObj.isStudy"
                            data-type="newpost.email" type="button">
                        <div class="switch">
                        </div>
                        <div class="track">
                        </div>
                    </div>
                </span>
            </li>

            <div class="ulzu_right">
                <div class="new_curriculum_fmsztop">
                    <img ng-src="{{taskObj.img}}"  src="/images/train/fengmian098.png" style="height: 118px;" onerror="javascript:this.src='/images/train/fengmian098.png'">
                    <div class="new_curriculum_fmsztop_btn">
                        <div style="position: relative;width: 100%;"><i class="iconfont"></i> 上传封面
                            <input type="file" class="tool_file" nv-file-select="" uploader="uploader" accept=".jpg,.jpge,.png,.gif" style="width: 100%;height: 100%;">
                        </div>
                        <div style="position: absolute;width: 165px;top: 10px;height: 10px;">推荐尺寸：320px*180px</div>
                    </div>
                </div>
            </div>
        </ul>
        <!-- 培训人群 -->
        <ul class="ulzu">
            
            <li><span><i class="iconfont">&#xe6e7;</i>培训人群：</span> <span class="lirbtn">
                全员参与<div class="toggle" style="float: right;margin-left: 10px;margin-top: 5px;">
                    <input class="notificationHandler check" ng-class="{checked:taskObj.is_public}" ng-click="checkedStuParticipate()"
                        data-type="newpost.email" type="button">
                    <div class="switch">
                    </div>
                    <div class="track">
                    </div>
                </div>

            </span></li>
           
            <!--用户-->
            <li ng-repeat="userItem in stuData.UserList">
                <span><svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-user"></use></svg>【用户】{{userItem.user_Name}}</span>
                    <span class="lirbtn" ng-click="delStu(userItem,'1');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>   
            </li>
            <!--组织机构-->
            <li ng-repeat="orgItem in stuData.userOrgList">
                <span><svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-zuzhijiagou"></use></svg>【组织架构】{{orgItem.organization_Name}}</span>
                    <span class="lirbtn" ng-click="delStu(orgItem,'2');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>  
            </li>
            <!--角色-->
            <li ng-repeat="roleItem in stuData.userRoleList">
                <span><svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-jiaose"></use></svg>【角色】{{roleItem.roles_Name}} </span>
                    <span class="lirbtn" ng-click="delStu(roleItem,'3');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>  
            </li>
            <!--用户组-->
            <li ng-repeat="groupItem in stuData.userGroupList">
                <span><svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-louyutubiaoyonghuzu"></use></svg>【用户组】{{groupItem.userGroup_Name}} </span>
                    <span class="lirbtn" ng-click="delStu(groupItem,'4');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>  
            </li>
            <!-- 添加人群 -->
            <li>
                <div class="btn add link" ng-click="selTaskStu($event)">
                    <span ng-if="!taskObj.is_public"><i class="iconfont">&#xe616;</i>选择参与人群</span>
                    <span ng-if="taskObj.is_public" style="color: red;"><i class="iconfont">&#xe616;</i>选择排除人群</span>
                </div>
            </li>
        </ul>
         <!--人员选择器-->
         <selectormodal ng-if="stuData.ApiOpen" apidata="stuData"  uploader="uploader"></selectormodal>
        <!-- 培训内容 -->
        <!--知识选择器开始-->
        <knowledge-selector know-config="knowConfig" ng-if="knowConfig.isShow" on-callback="onCallback()"></knowledge-selector>
        <!--文件选择器开始-->
        <knowledge-selector know-config="fileConfig" ng-if="fileConfig.isShow"  on-callback="onFileCallback()"></knowledge-selector>
        <ul class="ulzu">
            <li><span><i class="iconfont"></i>培训内容：</span>
                   <span class="lirbtn">
                        强制顺序学习
                        <div class="toggle" style="float: right;margin-left: 10px;margin-top: 5px;"  ng-click="checkedOrder()">
                            <input class="notificationHandler check" ng-class="{checked:taskObj.arrage.isOrder}"
                                data-type="newpost.email" type="button">
                            <div class="switch">
                            </div>
                            <div class="track">
                            </div>
                        </div>
                    </span>

            </span>
             </li>
            <!-- 阶段 -->
            <li class="ulzu_tab" style="border-bottom-color: #ddd">
                <span ng-repeat="stageItem  in taskObj.arragetype | limitTo:5" ng-click="selStageObj(stageItem)" ng-class="{'active':stageItem.key == selStageFlag}">
                    <!--{{'第'+stageItem.key+'阶段'}}-->

                    <input type="text" ng-model="stageItem.keyName" title="单击可编辑" style="border: none;width: 80%;" ng-blur="editItemName(stageItem)">
                    <i class="iconfont" ng-click="delStageObj(stageItem);$event.stopPropagation();">&#xe636;</i>
                </span>                                
                <span class="active" ng-if="false">第一阶段<i class="iconfont" ng-click="delStageObj(stageItem);$event.stopPropagation();">&#xe636;</i></span>
                <i class="iconfont add link" style="margin-left: 10px;" ng-click="addStageObj()">&#xe7f7;</i>
                <!--展开 超3个后有下拉列表-->
                <div class="gengduo" ng-if="taskObj.arragetype.length > 5"
                    ng-mousemove="stageListShow=true" ng-mouseleave="stageListShow = false">
                    <i class="iconfont add link">&#xe6e8;</i>
                    <ul class="dropdown-menu" style="top: 25px;left: 0;z-index: 99;" ng-show="stageListShow">
                        <!--点击展开阶段-->
                        <li ng-repeat="stageItem  in taskObj.arragetype " ng-class="{'active':stageItem.key == selStageFlag}" style="overflow: hidden;" 
                            ng-click="selStageObj(stageItem)">
                               <!-- <span style="float: left;">{{'第'+stageItem.key+'阶段'}}</span>-->
                                 <input type="text" ng-model="stageItem.keyName" title="单击可编辑" style="border: none;width: 80%;" ng-blur="editItemName(stageItem)">
                                <i class="iconfont" style="float: right;" ng-click="delStageObj(stageItem);$event.stopPropagation();">&#xe636;</i>
                        </li>
                    </ul>
                </div>
            </li>                                    
            <!-- 阶段内容 -->
                <!--课程-->
                <!--ng-if="kscItem.course_Id!=null && kscItem.course_Id!=''"-->
                <li ng-repeat="kscItem in kscTaskList" ng-if="kscItem.course_Id!=null && kscItem.course_Id!=''" >
                    <span><i class="iconfont">&#xe652;</i>【课程】{{kscItem.course_Name}}</span>
                    <span class="lirbtn" style="margin-right: 35px;">
                        <div ng-if="taskObj.arrage.isOrder" style="width: 105px;">
                            排序码：<input type="number"  min="0" ng-model="kscItem.order" placeholder="0" title="输入排序码，越小越靠前" style="border: none;width: 40%;">
                        </div>
                        <!-- <select ng-model="kscItem.studyType"  min="0" style="border:1px solid #ccc;" ng-if="!taskObj.arrage.isOrder">
                            <option value="">不设置</option>
                            <option value="1">选修</option>
                            <option value="2">必修</option>
                        </select> -->
                    </span>
                    <span class="lirbtn" ng-click="delStageFile(kscItem,'1');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>   
                </li>
                <!--试卷-->
                <!--ng-if="kseItem.paperId!=null && kseItem.paperId!=''"-->
                <li ng-repeat="kseItem in kseTaskList" ng-if="kseItem.paperId!=null && kseItem.paperId!=''">
                    <span><i class="iconfont">&#xe77e;</i>【试卷】{{kseItem.paperName}}</span>
                    <span class="lirbtn" style="margin-right: 35px;">
                    <div ng-if="taskObj.arrage.isOrder" style="width: 105px;">
                        排序码：<input type="number"  min="0" ng-model="kseItem.order" placeholder="0" title="输入排序码，越小越靠前" style="border: none;width: 40%;">
                    </div>
                    </span>
                    <span class="lirbtn" ng-click="delStageFile(kseItem,'2');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span> 
                </li>
                <!--知识结构-->
                <!--ng-if="kssItem.knowledge_Id!=null && kssItem.knowledge_Id!=''"-->
                <li ng-repeat="kssItem in kssTaskList" ng-if="kssItem.knowledge_Id!=null && kssItem.knowledge_Id!=''" >
                    <span><i class="iconfont">&#xe650;</i>【知识结构】{{kssItem.knowledge_Name}}
                        <!--课程-->{{kssItem.know_select_course?'课程':''}}
                        <!--试卷-->{{kssItem.know_select_exam?'试卷':''}}
                        <!--题库-->{{kssItem.know_select_que?'题库':''}}
                        <!--题库合格条件-->
                        <span ng-if="kssItem.know_select_que">
                            {{ kssItem.know_select_que_type == 1?'固定时长' : (kssItem.know_select_que_type
            == 2 ? '合格率' : '全部答完') }}       
                            <!--题库合格数值-->
                            {{(kssItem.know_select_que_type == 1||kssItem.know_select_que_type == 2)?kssItem.know_select_que_num:''}}
                            <!--题库合格单位-->
                            {{kssItem.know_select_que_type == 1?'分钟':(kssItem.know_select_que_type == 2?'%':'')}} 
                            </span>
                    </span>
                    <span class="lirbtn" style="margin-right: 35px;">
                    <div ng-if="taskObj.arrage.isOrder" style="width: 105px;">
                        排序码：<input type="number"  min="0" ng-model="kssItem.order" placeholder="0" title="输入排序码，越小越靠前" style="border: none;width: 40%;">
                    </div>
                    </span>
                    <span class="lirbtn" ng-click="delStageFile(kssItem,'3');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>                    
                </li>
                <!--文件-->
                <li ng-repeat="ksfItem in ksfTaskList">  
                    <span><i class="iconfont">&#xe755;</i>【文件】{{kscItem.fileName}}</span>
                    <span class="lirbtn" ng-click="delStageFile(ksfItem,'4');$event.stopPropagation();"><i class="iconfont  add link" >&#xe636;</i></span>                
                </li>
            <li>
                <div class="btn add link" ng-click="modifyOrder()">
                    <i class="iconfont">&#xe616;</i>选择培训内容</div>
            </li>
        </ul>
        <ul class="ulzu">
            <li><i class="iconfont">&#xe658;</i>完成可获得积分：<input type="text" placeholder="0" class="xiaoge" style="width: 80px" ng-model="taskObj.integral" tooltips  tooltip-template="当学员完成该课程时，可获得对应的积分" > 
            </li>
            <li><span><i class="iconfont">&#xe63a;</i>培训时间：</span> 
            <div class="knowledgebase_trainingplan_dropdown_xztime" style="width:370px;">
                <!--周期-->
                <div class="knowledgebase_trainingplan_dropdown_xztime_date" ng-if="taskObj.date_formate == '1'">
                    <!--开始日期-->
                    <input type="text" ng-model="taskObj.start_Date" id="startTaskDate" class="xiaoge"
                        placeholder="开始日期" onclick="var endDate=$dp.$('endTaskDate');wdatepicker({dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){endTaskDate.focus();},maxDate:'#F{$dp.$D(\'endTaskDate\')}'})" ng-focus="GetDate()"
                        style="width:135px;"/>
                    <!--开始时间-->
                    <input type="text" ng-model="taskObj.start_time" id="startTime" class="xiaoge"
                    placeholder="时间" onclick="var endTime=$dp.$('endTime');wdatepicker({dateFmt:'HH:mm',onpicked:function(){endTime.focus();},maxDate:'#F{$dp.$D(\'endTime\')}'})"
                    ng-focus="GetTime()" 
                    style="width:33px" ng-if="false"/>
                    <ac style="color:#666">至</ac>
                    <!--截止日期-->
                    <input type="text" ng-model="taskObj.end_Date" class="xiaoge" id="endTaskDate"
                        placeholder="截止日期" onclick="wdatepicker()" ng-focus="GetDate()" onfocus="wdatepicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startTaskDate\')}'})"
                        style="width:135px;"/>
                    <!--截止时间-->
                    <input type="text" ng-model="taskObj.end_time" class="xiaoge" id="endTime"
                    placeholder="时间" onclick="wdatepicker({dateFmt:'HH:mm',minDate:'00:00',maxDate:'23:59'})"
                    ng-focus="GetTime()" onfocus="wdatepicker({dateFmt:'HH:mm',minDate:'#F{$dp.$D(\'startTime\')}'})"
                        style="width:33px;" ng-if="false"/>                                                                              
                </div>                                   
                <!--天数-->
                <div class="knowledgebase_trainingplan_dropdown_xztime_date" ng-if="taskObj.date_formate == '2'">
                    <input type="text" ng-model="taskObj.date_formate_time" class="xiaoge" style="width:35px;"/>天                                        
                </div>
            </div> 
            <!--选择类型  -->                                                                                                                
            <span class="lirbtn" ng-click="trainTaskAddEidtDrapDownIsShow = true" ng-mouseleave="trainTaskAddEidtDrapDownIsShow = false">
                {{ taskObj.date_formate == '1' ? '固定周期' : (taskObj.date_formate
                == '2' ? '固定天数' : '不限制') }}   
               <span class="caret"></span>
               <ul ng-show="trainTaskAddEidtDrapDownIsShow" 
                    style="border-radius: 3px;position: absolute;right:5px;bottom:30px; width: 86px;background: #fff;border: 1px solid #ddd;box-shadow: 0 7px 21px rgba(0,0,0,0.1);"> 
                    <li class="traintask_top_pxjd_all" ng-click="setDateType('0')">                                            
                        不限制</li>
                    <li class="traintask_top_pxjd_wks" ng-click="setDateType('1')">                                            
                        固定周期</li>                                                                                            
                    <li class="traintask_top_pxjd_ywc"ng-click="setDateType('2')">                                            
                        固定天数</li>
                </ul>          
            </span> 
           </li>
           
           <li><i class="iconfont">&#xe6e9;</i>任务描述：
                <span class="lirbtn" style="top: 5px" ng-click="showFileText()">
                    <span><i class="iconfont link">&#xe629;</i>切换完整编辑器</span>
                </span>
            </li>
            <li><textarea class="xiaoge " placeholder="请输入任务描述" rows="5" cols="5" ng-model="taskObj.arrage_Description"
                style="height: 50px; width: 100%;"></textarea></li>
           
        </ul>
        <div class="title">
            <h2>更多设置</h2>
            <div class="lirbtn">
            <span ng-click="showMore=!showMore"><i class="iconfont">{{showMore?'&#xec51;':'&#xec50;'}}</i> {{showMore?'收起':'展开'}}</span>
            </div><div class="clear"></div>
        </div>
        <ul class="ulzu" ng-if="showMore">
           
            <li>
                <div class="knowledge_structure_add_column">
                    <div class="knowledge_structure_add_fzr">
                        <div class="knowledge_structure_add_fzrtitle" style="float: left;"><i class="iconfont"></i>负责人：</div>
                        <div class="knowledge_structure_add_fzrmain" style="float: left;">
                            <div>
                            <div ng-repeat="user in personDataUser.UserList" style="float: left;padding: 0;"> 
                                    <img ng-src="{{user.user_Img}}" src="/images/avatar.png" onerror="javascript:this.src='/images/avatar.png'" class="personnelIMname img" style="height:36px;width:36px;border-radius:50%;margin-right:10px;margin-bottom:5px;padding:0"/>
                            </div>
                            <div ng-click="showPersonSelect($event)"  style="float: left;"  tooltips tooltip-side="right"  tooltip-template="负责人可在列表中看见当前任务，负责人设置为学员无效！"><div  class="checkboxsxtjtj">+</div></div>
                            </div>
                        </div>
                    </div>
                </div>   
            </li>
            <div style=" padding:5px; height: 95px;">
                <div ng-repeat="kbinfo in taskObj.arrage.ksfList" style="color:#666;text-align: center;overflow: hidden;float: left; height:65px; padding:10px 5px;width: 14%;font-size: 12px;" title="{{kbinfo.fileName}}">
                    <img ng-src="/images/fileicon/{{kbinfo.fileType}}_56.png" height="40" src="/images/fileicon/qita_56.png" onerror="javascript:this.src='/images/fileicon/qita_56.png'" />
                   <br/>{{kbinfo.fileName}}
                </div>
                <div ng-click="selFile($event)" style="cursor: pointer; text-align: center;float: left; height:65px; padding:10px 5px;width: 14%;font-size: 12px;" >
                    <div tooltips tooltip-side="top"  tooltip-template="您可以选择知识库的文件作为任务附件，最多选择5个文件！">
                        <img src="/images/fileicon/upadd_56.png" height="40" />
                    <br/>选择附件
                    </div>
                </div>
                
            </div>
        </ul>
    </div>
    <selectormodal  ng-if="personDataUser.ApiOpen" apidata="personDataUser" ></selectormodal>
    <div class="ntw_footer">
        <div style="float: left; top: 3px; position: relative;">
            <h2>
                是否通知：</h2>
            <div class="toggle">
                <input class="notificationHandler check" ng-class="{checked:taskObj.arrage.send_flag==2}"
                    ng-click="checkedEmail()" data-type="newpost.email" type="button">
                <div class="switch">
                </div>
                <div class="track">
                </div>
            </div>
        </div>
        <div class="new_curriculum_bottom_right">
            <div ng-if="isSaveBtn" class="btn">
                <btnloading isbtnload="isSaveBtn"></btnloading>
            </div>
            <div class="btn queding" style="width: 100px;"  ng-click="btnSave()" ng-if="!isSaveBtn">                
                <span class="ng-scope"><i class="iconfont">&#xe6ee;</i> 确定保存</span>
            </div>
        </div>
    </div>
    <!--图文类型新增/编辑-->
<div class="knowledgebase_xinjian_body" ng-if="showfileTxt">
    <div class="knowledgebase_xinjian_bj">
    </div>
    <div class="knowledgebase_select_move_body">
        <div class="knowledgexjjsb" ng-style="divnotepad">
            <div class="knowledgexjjsbbody">
                <div class="knowledgexjjsbtitle" style="padding-top: 25px;">
                    <div class="knowledgexjwjcmmtitleright" ng-if="isbtnload">
                        <btnloading isbtnload="isbtnload"></btnloading>
                    </div>
                    <div class="knowledgexjjsbtitleright" ng-click="showFileText()" ng-if="!isbtnload">
                        <svg class="icon" aria-hidden="true"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-baocun"></use></svg>
                        保存</div>
                    <div class="close" ng-click="showFileText()" style="margin: 0">
                        <span>+</span></div>
                </div>
                <div contenteditable="true" ng-model="taskObj.arrage_Description" configbtn="configbtnjishiben"
                    style="height: 500px; clear: none;">
                </div>
            </div>
        </div>
    </div>
</div>
</div>
